@import "variables";

.h-container {
  display: flex;
  flex-direction: row;
  flex: 1;
  flex-basis: auto;
  box-sizing: border-box;
  min-width: 0;

  &.is--fluid {
    width: 100%;
    height: 100%;
  }

  &.is-gutter {
    padding: $h-container-gutter;
  }

  &.is--vertical {
    flex-direction: column;
  }

  &.is--justify-center {
    justify-content: center;
  }

  &.is--justify-start {
    justify-content: flex-start;
  }

  &.is--justify-end {
    justify-content: flex-end;
  }

  &.is--justify-between {
    justify-content: space-between;
  }

  &.is--justify-around {
    justify-content: space-around;
  }
}

.h-header {
  flex-shrink: 0;
  box-sizing: border-box;
  background-color: $h-container-background;

  &.is--gutter {
    padding: $h-container-gutter;
  }

  &.is--separate {
    margin-bottom: $h-container-separate;
  }

  &.is--border {
    border-bottom: 1px solid #EEEEEE;
  }

  &[class*="is--justify-"] {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  &.is--justify-center {
    justify-content: center;
  }

  &.is--justify-start {
    justify-content: flex-start;
  }

  &.is--justify-end {
    justify-content: flex-end;
  }

  &.is--justify-between {
    justify-content: space-between;
  }

  &.is--justify-around {
    justify-content: space-around;
  }

  .el-form--inline > .el-form-item {
    margin-bottom: 0;
  }
}

.h-footer {
  flex-shrink: 0;
  box-sizing: border-box;
  background-color: $h-container-background;

  &.is--gutter {
    padding: $h-container-gutter;
  }

  &.is--separate {
    margin-top: $h-container-separate;
  }

  &.is--border {
    border-top: 1px solid #EEEEEE;
  }

  &[class*="is--justify-"] {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  &.is--justify-center {
    justify-content: center;
  }

  &.is--justify-start {
    justify-content: flex-start;
  }

  &.is--justify-end {
    justify-content: flex-end;
  }

  &.is--justify-between {
    justify-content: space-between;
  }

  &.is--justify-around {
    justify-content: space-around;
  }
}

.h-aside {
  flex-shrink: 0;
  box-sizing: border-box;
  background-color: $h-container-background;

  &.is--gutter {
    &:not(.is--scrollbar) {
      padding: $h-container-gutter;
    }
  }

  &.is--scrollbar {
    &.is--gutter > .el-scrollbar > .h-scrollbar__wrap > .el-scrollbar__view {
      padding: $h-container-gutter;
    }

    &:not(.is--gutter) > .el-scrollbar > .h-scrollbar__wrap > .el-scrollbar__view {
      padding-right: 10px;
    }
  }

  &.is--separate-left {
    margin-left: $h-container-separate;
  }

  &.is--separate-right {
    margin-right: $h-container-separate;
  }

  &[class*="is--justify-"] {
    display: flex;
    flex-direction: column;
  }

  &.is--justify-center {
    justify-content: center;
  }

  &.is--justify-start {
    justify-content: flex-start;
  }

  &.is--justify-end {
    justify-content: flex-end;
  }

  &.is--justify-between {
    justify-content: space-between;
  }

  &.is--justify-around {
    justify-content: space-around;
  }
}

.h-main {
  display: block;
  flex: 1;
  flex-basis: auto;
  height: 100%;
  box-sizing: border-box;
  background-color: $h-container-background;
  overflow: auto;

  &.is--gutter {
    &:not(.is--scrollbar) {
      padding: $h-container-gutter;
    }
  }

  &.is--scrollbar {
    &.is--gutter > .el-scrollbar > .h-scrollbar__wrap > .el-scrollbar__view {
      padding: $h-container-gutter;
    }

    &:not(.is--gutter) > .el-scrollbar > .h-scrollbar__wrap > .el-scrollbar__view {
      padding-right: 10px;
    }
  }
}

.h-flex {
  display: flex;

  &.is--row {
    flex-direction: row;
  }

  &.is--column {
    flex-direction: column;
  }

  &.is--fluid {
    height: 100%;
  }

  &.is--align-center {
    align-items: center;
  }

  &.is--align-start {
    align-items: flex-start;
  }

  &.is--align-end {
    align-items: flex-end;
  }

  &.is--justify-center {
    justify-content: center;
  }

  &.is--justify-start {
    justify-content: flex-start;
  }

  &.is--justify-end {
    justify-content: flex-end;
  }

  &.is--justify-between {
    justify-content: space-between;
  }

  &.is--justify-around {
    justify-content: space-around;
  }
}

.h-list {
  box-sizing: border-box;

  &.is--fluid{
    height: 100%;
    overflow: auto;
  }

  .van-pull-refresh {
    min-height: 100%;
  }
}

.h-tabs {
  &.is--fluid {
    display: flex;
    flex-direction: column;
    height: 100%;

    .van-tabs__wrap {
      flex-shrink: 0;
    }

    .van-tabs__content {
      flex: 1;
      overflow: hidden;

      .van-tab__pane {
        height: 100%;
      }
    }
  }
}
